package main

import (
	"fmt"
	"kongyixueyuan.com/MyPublicChain/part9-Serialize-DeserializeBlock/BLC"

)

func main() {

	block :=BLC.NewBlock("Test",1,[]byte{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})
	fmt.Println(block.Nonce)
	fmt.Printf("hash ->  %x\n",block.Hash)

	bytes := block.SeriaLize()
	fmt.Println(bytes)

	block = BLC.DeserializeBlock(bytes)

	fmt.Printf("%d\n",block.Nonce)
	fmt.Printf("hash2 -> %x\n",block.Hash)

}
